package com.info.zhiduoduo.common.excelconverter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

/**
 * 充值状态 1:申请中 2:确认中 3:已完成
 */
public class CompanyRechargeStateConverter implements Converter<Integer> {

	@Override
	public Class supportJavaTypeKey() {
		return null;
	}

	@Override
	public CellDataTypeEnum supportExcelTypeKey() {
		return null;
	}

	@Override
	public Integer convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty,
	                                 GlobalConfiguration globalConfiguration) throws Exception {
		return 1;
	}

	@Override
	public CellData convertToExcelData(Integer integer, ExcelContentProperty excelContentProperty,
	                                   GlobalConfiguration globalConfiguration) throws Exception {
		if (integer == null) {
			return new CellData("");
		} else if (integer == 1) {
			return new CellData("申请中");
		} else if(integer == 2){
			return new CellData("确认中");
		} else if(integer == 3){
			return new CellData("已完成");
		} else {
			return new CellData("");
		}
	}
}
